import javax.swing.JFrame;

import javax.swing.JFrame;

public class main {
    public static void main(String[] args) {
        // 创建窗口
        JFrame frame = new JFrame("Shape Manager");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(500, 500);

        // 创建ShapeManager实例
        ShapeManager shapeManager = new ShapeManager();
        frame.add(shapeManager); // 将ShapeManager添加到窗口
        Rectangle rect = new Rectangle(new Point(10, 10), 100, 200);
        Triangle tri = new Triangle(new Point(0, 10), new Point(50, 50), new Point(150, 0));
        Circle cir = new Circle(new Point(100, 100), 100);
        shapeManager.addShape(rect);
        shapeManager.addShape(tri);
        shapeManager.addShape(cir);
        shapeManager.drawShapes();
        shapeManager.delShape(rect);
        shapeManager.drawShapes();
        frame.setVisible(true);
    }
}